feat: gcp pubsub admin endpoints#4957
Conversation
…pubsub-span-links
…pubsub-admin-endpoints
…pubsub-span-links
…pubsub-admin-endpoints
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 19 changed files in this pull request and generated 4 comments.
Files not reviewed (2)
- internal/orchestrion/_integration/gcp_pubsub.v1/generated_test.go: Generated file
- internal/orchestrion/_integration/gcp_pubsub.v2/generated_test.go: Generated file
Comments suppressed due to low confidence (1)
contrib/cloud.google.com/go/pubsubtrace/tracing.go:221
- The comment above projectIDFromResourceName is now misleading: the implementation extracts the project ID from any resource name starting with "projects/" (including bare "projects/{project}" used by admin operations), not just topics/subscriptions.
// extracts the GCP project ID from a Pubsub resource name of the form
// "projects/{project}/topics/{topic}" or "projects/{project}/subscriptions/{subscription}"
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 19 changed files in this pull request and generated 4 comments.
Files not reviewed (2)
- internal/orchestrion/_integration/gcp_pubsub.v1/generated_test.go: Generated file
- internal/orchestrion/_integration/gcp_pubsub.v2/generated_test.go: Generated file
Comments suppressed due to low confidence (3)
internal/orchestrion/_integration/gcp_pubsub.v2/gcp_pubsub_admin.go:122
- adminTrace hard-codes the project ID tag to testProject, but the resource paths are built from b.projectID (from the container settings). If these ever differ, traces will be inconsistent.
ext.GCPProjectID: testProject,
internal/orchestrion/_integration/gcp_pubsub.v1/gcp_pubsub_admin.go:123
- adminTrace hard-codes the project ID tag to adminProject, but the resource paths are built from b.projectID (from the container settings). If these ever differ, traces will be inconsistent.
ext.GCPProjectID: adminProject,
contrib/cloud.google.com/go/pubsubtrace/tracing.go:221
- This comment has an unmatched quote and an incomplete example ("projects/{project}. ..."), which makes it unclear what formats are supported.
// extracts the GCP project ID from a Pubsub resource name starting with
// "projects/{project}. e.g. schemas, snapshots, topics and subscriptions
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 19 changed files in this pull request and generated 2 comments.
Files not reviewed (2)
- internal/orchestrion/_integration/gcp_pubsub.v1/generated_test.go: Generated file
- internal/orchestrion/_integration/gcp_pubsub.v2/generated_test.go: Generated file
rarguelloF
left a comment
There was a problem hiding this comment.
As discussed during our meeting, let's leave the REST client for a follow-up PR. Nice work! @ojproductions
|
/merge -m squash |
|
View all feedbacks in Devflow UI.
This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
devflow unqueued this merge request: It did not become mergeable within the expected time |
What does this PR do?
Implements instrumentation for admin endpoints across v1 and v2 listed in the tables below
Common Span Tags (All Admin Operations)
All admin operations are traced via
TraceAdminincontrib/cloud.google.com/go/pubsubtrace/tracing.goand share these tags:span.typeworkerext.SpanTypeWorkerspan.kindclientext.SpanKindClientmessaging.systemgooglepubsubext.MessagingSystemGCPPubsubcomponentcloud.google.com/go/pubsub.v1(v1) orcloud.google.com/go/pubsub.v2(v2)pubsub.method"CreateTopic","DeleteSubscription"resource.name"<method> <resourcePath>"<method>if path is emptygcloud.project_id"projects/"trueWithMeasured()requestSpanNameinstr.OperationName(ComponentClient, nil)V1 vs V2 Client Type Mapping
PublisherClient(cloud.google.com/go/pubsub/apiv1)TopicAdminClient(cloud.google.com/go/pubsub/v2/apiv1)SubscriberClient(cloud.google.com/go/pubsub/apiv1)SubscriptionAdminClient(cloud.google.com/go/pubsub/v2/apiv1)SchemaClient(cloud.google.com/go/pubsub/apiv1)SchemaClient(cloud.google.com/go/pubsub/v2/apiv1)Topic Operations
pubsub.methodgcloud.project_idset?CreateTopic"CreateTopic"req.GetName()TraceCreateTopicV1TraceCreateTopicUpdateTopic"UpdateTopic"req.GetTopic().GetName()TraceUpdateTopicV1TraceUpdateTopicGetTopic"GetTopic"req.GetTopic()TraceGetTopicV1TraceGetTopicListTopics"ListTopics"req.GetProject()"projects/...")TraceListTopicsV1TraceListTopicsListTopicSubscriptions"ListTopicSubscriptions"req.GetTopic()TraceListTopicSubscriptionsV1TraceListTopicSubscriptionsListTopicSnapshots"ListTopicSnapshots"req.GetTopic()TraceListTopicSnapshotsV1TraceListTopicSnapshotsDeleteTopic"DeleteTopic"req.GetTopic()TraceDeleteTopicV1TraceDeleteTopicDetachSubscription"DetachSubscription"req.GetSubscription()TraceDetachSubscriptionV1TraceDetachSubscriptionSubscription Operations
pubsub.methodgcloud.project_idset?CreateSubscription"CreateSubscription"req.GetName()TraceCreateSubscriptionV1TraceCreateSubscriptionGetSubscription"GetSubscription"req.GetSubscription()TraceGetSubscriptionV1TraceGetSubscriptionUpdateSubscription"UpdateSubscription"req.GetSubscription().GetName()TraceUpdateSubscriptionV1TraceUpdateSubscriptionListSubscriptions"ListSubscriptions"req.GetProject()"projects/...")TraceListSubscriptionsV1TraceListSubscriptionsDeleteSubscription"DeleteSubscription"req.GetSubscription()TraceDeleteSubscriptionV1TraceDeleteSubscriptionModifyPushConfig"ModifyPushConfig"req.GetSubscription()TraceModifyPushConfigV1TraceModifyPushConfigSeek"Seek"req.GetSubscription()TraceSeekV1TraceSeekSnapshot Operations
pubsub.methodgcloud.project_idset?GetSnapshot"GetSnapshot"req.GetSnapshot()TraceGetSnapshotV1TraceGetSnapshotListSnapshots"ListSnapshots"req.GetProject()"projects/...")TraceListSnapshotsV1TraceListSnapshotsCreateSnapshot"CreateSnapshot"req.GetName()TraceCreateSnapshotV1TraceCreateSnapshotUpdateSnapshot"UpdateSnapshot"req.GetSnapshot().GetName()TraceUpdateSnapshotV1TraceUpdateSnapshotDeleteSnapshot"DeleteSnapshot"req.GetSnapshot()TraceDeleteSnapshotV1TraceDeleteSnapshotSchema Operations
pubsub.methodgcloud.project_idset?CreateSchema"CreateSchema"req.GetParent()"projects/...")TraceCreateSchemaV1TraceCreateSchemaGetSchema"GetSchema"req.GetName()TraceGetSchemaV1TraceGetSchemaListSchemas"ListSchemas"req.GetParent()"projects/...")TraceListSchemasV1TraceListSchemasListSchemaRevisions"ListSchemaRevisions"req.GetName()TraceListSchemaRevisionsV1TraceListSchemaRevisionsCommitSchema"CommitSchema"req.GetName()TraceCommitSchemaV1TraceCommitSchemaRollbackSchema"RollbackSchema"req.GetName()TraceRollbackSchemaV1TraceRollbackSchemaDeleteSchemaRevision"DeleteSchemaRevision"req.GetName()TraceDeleteSchemaRevisionV1TraceDeleteSchemaRevisionDeleteSchema"DeleteSchema"req.GetName()TraceDeleteSchemaV1TraceDeleteSchemaValidateSchema"ValidateSchema"req.GetParent()"projects/...")TraceValidateSchemaV1TraceValidateSchemaValidateMessage"ValidateMessage"req.GetParent()"projects/...")TraceValidateMessageV1TraceValidateMessageMotivation
APMSVLS-536
view @pablomartinezbernardo's python implementation here
Questions:
Should we be instrumenting v1? Its being deprecated by google
Reviewer's Checklist
make lintlocally.make testlocally.make generatelocally.make fix-moduleslocally.Unsure? Have a question? Request a review!